package com.applozic.mobicomkit.uiwidgets.conversation.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.TextView;

import com.applozic.mobicomkit.uiwidgets.conversation.adapter.MobicomMultimediaPopupAdapter;
import com.lottery.ruok.lottrey.R;
import com.lottery.ruok.lottrey.ui.component.BaseRelativeLayout;

import butterknife.BindView;

public class MobicomMultimediaItemView extends BaseRelativeLayout {
    @BindView(R.id.mobicom_multimedia_icon)
    ImageView mobicomMultimediaIcon;
    @BindView(R.id.mobicom_multimedia_text)
    TextView mobicomMultimediaText;
    private MobicomMultimediaPopupAdapter.MobicomMultimediaModel data;

    public MobicomMultimediaItemView(Context context) {
        super(context);
    }

    public MobicomMultimediaItemView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MobicomMultimediaItemView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void init(Context context, AttributeSet attrs, int defStyleAttr) {

    }

    @Override
    protected void initView(Context context) {
        setContentView(R.layout.mobicom_individual_multimedia_option_item);

    }

    @Override
    protected void load(Context context) {

    }

    public void setData(MobicomMultimediaPopupAdapter.MobicomMultimediaModel data) {
        this.data = data;
        updateView();
    }

    private void updateView() {
        if (data != null) {
            mobicomMultimediaText.setText(data.getTitle());
            mobicomMultimediaIcon.setImageResource(data.getResId());
        }
    }
}
